package com.qire.manhua.controller;

import android.view.View;

import com.qire.antsrouter.AntsRouter;
import com.qire.common.constant.Navigation;
import com.qire.common.support.base.EventController;
import com.qire.manhua.activity.TeensControlPanelActivity;
import com.qire.manhua.databinding.ActivityTeensControlPanelBinding;
import com.qire.manhua.model.viewModel.impl.TeensControlPanelViewModel;

import androidx.annotation.NonNull;

public class TeensControlPanelController extends EventController<TeensControlPanelActivity> {

    private TeensControlPanelViewModel viewModel;

    public TeensControlPanelController(@NonNull TeensControlPanelActivity lifecycleOwner) {
        super(lifecycleOwner);
    }

    @Override
    protected void bindView() {
        ActivityTeensControlPanelBinding viewDataBinder = owner.viewDataBinder();
        viewDataBinder.setTeensControlPanelController(this);
    }


    @Override
    protected void onCleared() {
        super.onCleared();
        this.viewModel = null;
    }

    public void onAddition(TeensControlPanelViewModel viewModel) {
        this.viewModel = viewModel;
    }

    /*************************************************************************************************************************/

    public void backBtnOnclick(View view) {
        owner.onBackPressed();
    }

    public void changePasswordBtnOnClick(View view) {
        AntsRouter.ROUTER.buildCard(Navigation.Page.TeensModifyPasswordPage).navigation();
    }

    public void disableBtnOnClick(View view) {
        AntsRouter.ROUTER.buildCard(Navigation.Page.TeensModeTogglePage).navigation();
    }

    public void enableBtnOnClick(View view) {
        AntsRouter.ROUTER.buildCard(Navigation.Page.TeensModeTogglePage).navigation();
    }

}
